<template>
	<div class="aside_news animated fadeInLeft">
		<div class="aside_news_item" v-for="(item, index) in feedsData" v-if="index<10 && item">
			<router-link target="_blank" :to="{name:'view', params:{channel:item.type,id:item.newsid,day:item.pubDate}}">
				<h1>{{item.title}}</h1>
				<p>{{item.pubDate}} - {{item.type}}</p>
			</router-link>
		</div>
	</div>
</template>
<script>
	export default{
		name:"aside_news",
		data: function(){
			return{}
		},
		props:["feeds"],
		computed:{
			feedsData:function(){
				var a = $.extend([], this.$props.feeds);
				$.each(a, (i, item) => {
					item && item.pubDate && (a[i] = $.extend(item, {
						pubDate: window.dateFormat(new Date(item.pubDate).getTime())
					}))
				})
				return a;
			}
		},
		mounted:function(){

		},
		watch:{
			$route:function(v){
				this.$emit("getNewsContent")
				window.scrollTo(1,1)
			}
		},
		methods:{
		}
	}
</script>
<style lang="less">
	@base:23.44/1rem;
	.aside_news{
		.aside_news_item{
			font-size: 20/@base;
			background-color: #fff;
			margin:0 0 10/@base 0;
			padding:20/@base;
			min-height:100/@base;
			a{
				display:block;
				text-decoration: none;
				color:#333;
				h1{
					font-size: 24/@base;
					font-weight: 400;
					word-break:break-all;
					word-wrap: break-word;
					height:61/@base;
					overflow: hidden;
				}
				p{
					margin:10/@base 0;
					color:#ccc;
				}
			}
			&:last-child{
				margin:0;
			}
		}
	}
</style>